import request from '@u/request'
// 获取商品列表
const fetchItems = (params = {}) => (
  request.post('/shop/goods/list/v2', params)
)
// 首页轮播
const fetchHomeBanner = (params = {}) => {
  return request.get('/banner/list', { params })
}
// 分类详情
const fetchCartList = (params = {}) => {
  return request.get('/shop/goods/category/all', { params })
}
// 获取商品详情
const fetchItemDetail = (params = {}) => {
  return request.get('/shop/goods/detail', { params })
}
// 用户注册
const goReg = (params = {}) => (
  request.post('/user/username/register', params)
)
// 用户登录
const goLogin = (params = {}) => (
  request.post('/user/username/login', params)
)
export {
  fetchItems,
  fetchHomeBanner,
  fetchCartList,
  fetchItemDetail,
  goReg,
  goLogin
}